package com.hzystudynote;

import java.util.Map;
import java.util.TreeMap;

/** @author ASUS */
public class ValueClass {
  public static void main(String[] args) {
    TreeMap<Integer, Person> tests = new TreeMap<>();
    tests.put(1, new Person("hzy", 20, "male"));
    for (Map.Entry<Integer, Person> entry : tests.entrySet()) {
      System.out.println(entry.getValue());
    }
    Person tmpPerson = tests.get(1);
    System.out.println(tmpPerson);
  }
}

class Person {
  private final int age;
  private final String sex;
  public String name;

  public Person(String name, int age, String sex) {
    this.name = name;
    this.age = age;
    this.sex = sex;
  }

  @Override
  public String toString() {
    return "Person [name=" + name + ", age=" + age + ", sex=" + sex + "]";
  }
}
